package com.ogawa.meiditest.activity

import androidx.appcompat.app.AppCompatActivity
import com.ogawa.meiditest.widget.LoadingDialog

open class BaseActivity :AppCompatActivity(){
    private var loadingDialog: LoadingDialog? = null

    fun showLoadingDialog(msg: String = "") {
        if (loadingDialog == null) {
            loadingDialog = LoadingDialog(this)
        }
        loadingDialog?.setMsg(msg)
        if (!loadingDialog?.isShowing!!) {
            loadingDialog?.show()
        }
    }

    fun dismissLoadingDialog() {
        if (loadingDialog != null && loadingDialog!!.isShowing) {
            loadingDialog!!.dismiss()
        }
    }
}